Skip to main content

Unit Properties

This document outlines all available properties for the Unit class in the Aurora Framework.

Custom Properties

addobjectproperty

Aurora.addobjectproperty(name: string, handler: fun(unit: Unit): any, options?: table) -> boolean

Registers a new Unit property at runtime. The helper returns true when the property is registered and caches it according to the supplied options.

Cache control: properties are cached by default. Pass options.cache = false (or options.cacheable = false) to keep the property in the non-cacheable list when its value should be recomputed every access.

-- Example: expose the channel remain percentage as a property
Aurora.addobjectproperty("channelingremainspct", function(unit)
local duration = unit.channelingduration
if not duration or duration <= 0 then
return 0
end

local remains = unit.channelingtimeremains
if remains <= 0 then
return 0
end

return (remains / duration) * 100
end, {
aliases = {"channelremainspct", "channelpctleft"},
cache = false,
})

Properties

Identification

guid

guid: string

The unique identifier for the unit

unit

unit: string|userdata

WoW unit token or object

id

id: boolean|number

Unit's ID

name

name: string

Unit's name

pointer

pointer: userdata|nil

Unit's memory pointer

creator

creator: guid|nil

Unit's creator

effects

effects: array

Returns a array of current active spell effects and there visual id and location

Health & Status

health

health: number

Current health value

healthmax

healthmax: number

Maximum health value

healthpercent

healthpercent: number

Health percentage (0-100)

hp

hp: number

Alias for health

effectivehp

effectivehp: number;

Effective health points (Taking absorbs and incoming heals into account)

healabsorb

healabsorb: number

Returns the total amount of healing absorption on the unit

stagger

stagger: number

Returns the stagger value of the unit

staggerpct

staggerpct: number

Returns the stagger percentage of the unit from 0 to 100

staggerhealth

staggerhealth: number

Returns the incoming stagger damage of the unit

isshielded

isshielded: number

Returns the unit's shield amount. Can be used as a boolean check - returns 0 if no shield is present, or the shield amount if one exists.

-- Example: Check if unit has any shield
local target = Aurora.UnitManager:Get("target")

if target.isshielded then
-- Unit is shielded
end

shieldamount

shieldamount: number

Returns the unit's total shield/absorb amount. This is an explicit property for getting shield values.

-- Example: Get exact shield amount
local target = Aurora.UnitManager:Get("target")

if target.exists then
print(target.shieldaamount)
end

dead

dead: boolean

Whether the unit is dead

alive

alive: boolean

Whether the unit is alive

exists

exists: boolean

Whether the unit exists

Combat & Threat

combat

combat: boolean

Whether the unit is in combat

threat

threat: number

Unit's threat level

aggro

aggro: boolean

Whether the unit has aggro

aggressive

aggressive: boolean

Whether the unit is aggressive

enemy

enemy: boolean

Whether the unit is an enemy

friend

friend: boolean

Whether the unit is friendly

reaction

reaction: number

Unit's reaction level towards the player

Movement & Position

position

position: Position

Unit's position in 3D space

speed

speed: number

Unit's movement speed

moving

moving: boolean

Whether the unit is moving

movingatall

movingatall: boolean

Whether the unit is moving at all

invehicle

invehicle: boolean

Whether the unit is in a vehicle

standing

standing: boolean

Whether the unit is standing still

sitting

sitting: boolean

Whether the unit is sitting down

height

height: number

Unit's height

combatreach

combatreach: number

Unit's combat reach distance

rotation

rotation: number

Unit's rotation in radians

reach

reach: number

Alias for combatreach

mounted

mounted: boolean

Whether the unit is mounted

timemoving

timemoving: number

Time in seconds the unit has been continuously moving

timestanding

timestanding: number

Time in seconds the unit has been continuously standing still

timecombat

timecombat: number

Time in seconds the unit has been continuously in combat

position

position: Position

Unit's position in 3D space

timeaggro

timeaggro: number

Time in seconds the unit has been aggroed

aggrotowards

aggrotowards(target: Unit): boolean

Returns whether this unit has aggro towards the specified target unit

Aurora.enemies:each(function(enemy)
if enemy.aggrotowards(player) then
print("Yay i got aggro")
end)

Unit Type & Classification

class

class: string

Unit's class name (localized)

class2

class2: string

Unit's class name in English

classid

classid: number

Unit's class ID

spec

spec: number

Unit's specialization ID

unitspecid

unitspecid: number

Unit's specialization ID using ObjectSpecializationID function

Aurora.Enums.SpecID Values
Aurora.Enums.SpecID = {
-- Death Knight
BLOOD = 250,
FROST_DK = 251,
UNHOLY = 252,

-- Demon Hunter
HAVOC = 577,
VENGEANCE = 581,

-- Druid
BALANCE = 102,
FERAL = 103,
GUARDIAN = 104,
RESTORATION_DRUID = 105,

-- Hunter
BEASTMASTERY = 253,
MARKSMANSHIP = 254,
SURVIVAL = 255,

-- Mage
ARCANE = 62,
FIRE = 63,
FROST_MAGE = 64,

-- Monk
BREWMASTER = 268,
WINDWALKER = 269,
MISTWEAVER = 270,

-- Paladin
HOLY_PALADIN = 65,
PROTECTION_PALADIN = 66,
RETRIBUTION = 70,

-- Priest
DISCIPLINE = 256,
HOLY_PRIEST = 257,
SHADOW = 258,

-- Rogue
ASSASSINATION = 259,
OUTLAW = 260,
SUBTLETY = 261,

-- Shaman
ELEMENTAL = 262,
ENHANCEMENT = 263,
RESTORATION_SHAMAN = 264,

-- Warlock
AFFLICTION = 265,
DEMONOLOGY = 266,
DESTRUCTION = 267,

-- Warrior
ARMS = 71,
FURY = 72,
PROTECTION_WARRIOR = 73,

-- Evoker
DEVASTATION = 1467,
PRESERVATION = 1468,
AUGMENTATION = 1473,
}

race

race: string

Unit's race name (localized)

race2

race2: string

Unit's race name in English

level

level: number

Unit's level

type

type: number

Unit's type ID

typestring

typestring: string

Unit's type as string

Unit Type Checks

isboss

isboss: boolean

Whether the unit is a boss

isbeast

isbeast: boolean

Whether the unit is a beast (Creature Type ID: 1)

isdragonkin

isdragonkin: boolean

Whether the unit is a dragonkin (Creature Type ID: 2)

isdemon

isdemon: boolean

Whether the unit is a demon (Creature Type ID: 3)

iselemental

iselemental: boolean

Whether the unit is an elemental (Creature Type ID: 4)

isgiant

isgiant: boolean

Whether the unit is a giant (Creature Type ID: 5)

isundead

isundead: boolean

Whether the unit is undead (Creature Type ID: 6)

ishumanoid

ishumanoid: boolean

Whether the unit is a humanoid (Creature Type ID: 7)

iscritter

iscritter: boolean

Whether the unit is a critter (Creature Type ID: 8)

ismechanical

ismechanical: boolean

Whether the unit is mechanical (Creature Type ID: 9)

isnotspecified

isnotspecified: boolean

Whether the unit type is not specified (Creature Type ID: 10)

istotem

istotem: boolean

Whether the unit is a totem (Creature Type ID: 11)

isnoncombatpet

isnoncombatpet: boolean

Whether the unit is a non-combat pet (Creature Type ID: 12)

isgascloud

isgascloud: boolean

Whether the unit is a gas cloud (Creature Type ID: 13)

Equipment & Gear

itemlevel

itemlevel: number

Returns the item level of the unit's equipped gear

-- Example: Check a player's item level
local player = Aurora.UnitManager:Get("player")
local ilvl = player.itemlevel

print("Current item level: " .. ilvl)

mainhandenchant

mainhandenchant: number

Whether the main hand weapon has an enchant

mhenchant

mhenchant: number

Alias for mainhandenchant. Whether the main hand weapon has an enchant

mainhandenchantremains

mainhandenchantremains: number

Time remaining on the main hand weapon enchant in seconds

mhenchantremains

mhenchantremains: number

Alias for mainhandenchantremains. Time remaining on the main hand weapon enchant in seconds

offhandenchant

offhandenchant: number

Whether the off hand weapon has an enchant

ohenchant

ohenchant: number

Alias for offhandenchant. Whether the off hand weapon has an enchant

offhandenchantremains

offhandenchantremains: number

Time remaining on the off hand weapon enchant in seconds

ohenchantremains

ohenchantremains: number

Alias for offhandenchantremains. Time remaining on the off hand weapon enchant in seconds

Rogue Poisons

These enchant properties do not detect rogue poisons. For tracking rogue poisons, use aura tracking methods instead:

Player-Facing Properties

facing

facing: number

Unit's facing direction in radians

playerfacing

playerfacing: boolean

Whether the player is facing the unit within 90 degrees

playerfacing30

playerfacing30: boolean

Whether the player is facing the unit within 30 degrees

playerfacing45

playerfacing45: boolean

Whether the player is facing the unit within 45 degrees

playerfacing60

playerfacing60: boolean

Whether the player is facing the unit within 60 degrees

playerfacing90

playerfacing90: boolean

Whether the player is facing the unit within 90 degrees

playerfacing180

playerfacing180: boolean

Whether the player is facing the unit within 180 degrees

Unit Counting

enemiesaround(radius)

enemiesaround(radius: number): number

Returns the number of enemy units within the specified radius of this unit

friendsaround(radius)

friendsaround(radius: number): number

Returns the number of friendly units within the specified radius of this unit

-- Example: Count friends within 10 yards
local nearbyFriends = unit.friendsaround(10)

friendsaroundhp(distance, hp)

friendsaroundhp(distance: number, hp: number): number

Returns the number of friendly units within the specified distance that are below the specified health percentage

-- Example: Count friends within 20 yards below 50% health
local injuredFriends = player.friendsaroundhp(20, 50)

Group Status

party

party: boolean

Whether the unit is in party

group

group: boolean

Whether the unit is in group

raid

raid: boolean

Whether the unit is in raid

ininstance

ininstance: boolean

Whether the unit is in a 5-player dungeon instance

inraid

inraid: boolean

Whether the unit is in a raid instance

inscenario

inscenario: boolean

Whether the unit is in a scenario instance

inpvp

inpvp: boolean

Whether the unit is in a PvP battleground instance

inbattleground

inbattleground: boolean

Alias for inpvp. Whether the unit is in a PvP battleground instance

inarena

inarena: boolean

Whether the unit is in an arena instance

indelve

indelve: boolean

Whether a Delve is currently in progress

solo

solo: boolean

Whether the unit is solo (not in party or raid)

Role Properties

role

role: string

Returns the unit's assigned role in group ("TANK", "HEALER", "DAMAGER", or "None")

ishealer

ishealer: boolean

Whether the unit is assigned as a healer

isdps

isdps: boolean

Whether the unit is assigned as a damage dealer

istank

istank: boolean

Whether the unit is assigned as a tank

Visibility & Interaction

visible

visible: boolean

Whether the unit is visible

los

los: boolean

Whether the unit is in line of sight

lootable

lootable: boolean

Whether the unit is lootable

skinnable

skinnable: boolean

Whether the unit is skinnable

tapdenied

tapdenied: boolean

Whether tap is denied for the unit

charmed

charmed: boolean

Whether the unit is charmed

isinteractable

isinteractable: boolean

Whether the unit can be interacted with (based on interaction icons)

-- Example: Check if an NPC can be interacted with
local npc = Aurora.UnitManager:Get("target")

if npc.exists and npc.isinteractable then
-- This NPC has interaction options available
print("Can interact with " .. npc.name)
end

Animation & Activities

animationid

animationid: number

Returns the unit's current animation kit ID

iseating

iseating: boolean

Whether the unit is currently eating

isdrinking

isdrinking: boolean

Whether the unit is currently drinking

issummoning

issummoning: boolean

Whether the unit is currently summoning someone using the summoning stone

Quest Properties

isquestieobjective

isquestieobjective: boolean

Whether the unit is a quest objective. This property integrates with the Questie addon to determine if the unit has incomplete quest objectives associated with it.

note
  • Requires the Aurora.QuestieModule to be enabled
  • Uses caching to improve performance with a configurable timeout
  • Only returns true for units with incomplete quest objectives
-- Example: Target quest mobs for priority
local target = Aurora.UnitManager:Get("target")

if target.exists and target.isquestieobjective then
-- This unit is needed for a quest
print("Targeting quest objective: " .. target.name)
end

Casting Information

casting

casting: string|false

Current cast name or false

casting1

casting1: string|false

Cast text

casting2

casting2: string|false

Cast texture

castingstart

castingstart: number

Cast start time

castingend

castingend: number

Cast end time

castingtrade

castingtrade: boolean

Whether casting a trade spell

castingid

castingid: string

ID of the spell being cast

castingnotinterruptible

castingnotinterruptible: boolean

Whether the cast cannot be interrupted

castinginterruptible

castinginterruptible: boolean

Whether the cast can be interrupted

castingspellid

castingspellid: number

ID of the spell being cast

castingremains

castingremains: number

Time remaining on the cast

castingpct

castingpct: number

Percentage of cast completed

castingduration

castingduration: number

Time in seconds that the unit has been casting the current spell

casttarget

casttarget: Unit|false

Returns the target of the unit's current cast as a Unit object, or false if no cast target

channeling

channeling: string|false

Current channel name or false

channeling1

channeling1: string|false

Channel text

channeling2

channeling2: string|false

Channel texture

channelingstart

channelingstart: number

Channel start time in seconds

channelingend

channelingend: number

Channel end time in seconds

channelingid

channelingid: string

ID of the channeled spell

channelingnotinterruptible

channelingnotinterruptible: boolean

Whether the channel cannot be interrupted

channelinginterruptible

channelinginterruptible: boolean

Whether the channel can be interrupted

channelingspellid

channelingspellid: number

Spell ID of the channeled spell

channelingremains

channelingremains: number

Percentage of channel time remaining (100 to 0)

channelingtimeremains

channelingtimeremains: number

Time remaining on the channel in seconds

channelingpct

channelingpct: number

Percentage of channel completed (100 to 0)

channelingduration

channelingduration: number

Time in seconds that the unit has been channeling the current spell

-- Example: Check how long a unit has been channeling
local target = Aurora.UnitManager:Get("target")

if target.channeling then
local duration = target.channelingduration
print("Has been channeling for " .. duration .. " seconds")
end

Combat Statistics

ttd

ttd: number

Time to die prediction

Power Types

chargedcp

chargedcp: number

Returns the number of charged combo points for the unit

chargedcompopoints

chargedcompopoints: number

Returns the number of charged combo points for the unit (alias for chargedcp)

Power types and their properties are documented in detail in the Power Types section.

Methods

Unit methods are documented in detail in the Unit Methods section.

Usage Example

-- All property accesses are actually method calls through metatables
local target = Aurora.UnitManager:Get("target")
local player = Aurora.UnitManager:Get("player")

-- Basic target checks
if target.exists and target.enemy and target.alive then
if target.hp < 20 and target.distanceto(player) < 30 then
-- Execute logic here
end
end

-- Example showing type checks and positioning
if target.ishumanoid and not target.ismechanical then
if target.playerfacing then
-- Use frontal cone melee ability on humanoid target
end
end

-- Aura examples
if target.exists then
-- Check for a specific debuff
local hasDeBuff = target.aura(12345)
if hasDeBuff then
local remaining = target.auraremains(12345)
if remaining < 3 then
-- Refresh debuff before it expires
end
end

-- Check aura stacks
local stacks = target.auracount(67890)
if stacks >= 5 then
-- Use ability that consumes stacks
end

-- Check for any aura from a list
local auraList = {12345, 67890, 11223}
if target.aurafrom(auraList) then
-- Unit has at least one of the auras
end
end

-- Combat and casting checks
if target.exists and target.casting then
if target.castinginterruptible and target.castingpct > 50 then
if player.distanceto(target) < 30 then
-- Interrupt the cast
end
end
end

Notes

note
  • Although properties appear to be accessed using dot notation (e.g., unit.health), they are actually method calls through Lua metatables
  • For clarity in documentation, we show them as properties, but internally they are methods
  • All "properties" can be called using either dot notation (unit.health) or method notation (unit:health())
  • The unit property can accept either a WoW unit token (e.g., "target", "player") or a unit object

Unit References

target

Returns a Unit object representing the unit's current target.

local unit = Aurora.UnitManager:Get("player")
local target = unit.target

if target.exists then
print("My target is " .. target.name)
end

-- Chain targeting
if unit.target.target.exists then
print("My target's target is " .. unit.target.target.name)
end

Unit Characteristics

These properties indicate whether a unit can be affected by various crowd control abilities. In dungeons (party instances), these are determined by the unit's type configuration. Outside of dungeons, all return true by default.

istauntable

istauntable: boolean

Whether the unit can be taunted. In dungeons, this is determined by the unit's taunt configuration.

isgrippable

isgrippable: boolean

Whether the unit can be gripped (Death Grip, etc.). In dungeons, this is determined by the unit's grip configuration.

isfearable

isfearable: boolean

Whether the unit can be feared. In dungeons, this is determined by the unit's fear configuration.

isrootable

isrootable: boolean

Whether the unit can be rooted. In dungeons, this is determined by the unit's root configuration.

issilenceable

issilenceable: boolean

Whether the unit can be silenced. In dungeons, this is determined by the unit's silence configuration.

isslowable

isslowable: boolean

Whether the unit can be slowed. In dungeons, this is determined by the unit's slow configuration.

isstunable

isstunable: boolean

Whether the unit can be stunned. In dungeons, this is determined by the unit's stun configuration.

isincapacitable

isincapacitable: boolean

Whether the unit can be incapacitated. In dungeons, this is determined by the unit's incapacitate configuration.

note

All these characteristics return true by default outside of dungeons. Inside dungeons, they check the unit's specific configuration in Aurora.Enums.UnitEnums.

-- Example: Check if a unit can be controlled before using CC
local target = Aurora.UnitManager:Get("target")

if target.exists and target.enemy then
if target.isstunable then
-- Use stun ability
elseif target.isrootable then
-- Use root ability instead
elseif target.isslowable then
-- Fall back to slow effect
end
end